﻿using System.Collections.Generic;
using System.Linq;
using AllIsWell.Core.Models;

namespace AllIsWell.Tests.TestData
{
    public static class DestinySeed
    {
        public static IEnumerable<Destiny> GetDestinies(IEnumerable<string> paths)
        {
            return paths.Select(GetDestiny);
        }

        public static Destiny GetDestiny(string path)
        {
            var destiny = GetDestiny(1);
            destiny.Path = path;
            return destiny;
        }

        public static Destiny GetDestiny(int destinyId)
        {
            var destiny = new Destiny 
            { 
                Id = destinyId , 
                Description = "Sample Description", 
                GreetingMessage = "Hello World!",
                Path = "Start It Well"
            };
            destiny.Whats = GetWhats(destiny);
            return destiny;
        }

        private static List<What> GetWhats(Destiny destiny)
        {
            return new List<What>(new[] { WhatSeed.GetWhat(1, destiny), WhatSeed.GetWhat(2, destiny) });
        }
    }
}
